/**
 * Copyright (c) 2010-2011 Pierre Labatut
 *
 * This file is part of Space-Chronicles project.
 *
 * Space-Chronicles is free software: you can redistribute it and/or modify it
 * under the terms of its license which may be found in the accompanying
 * LICENSE file or <http://code.google.com/p/space-chronicles/>.
 */

package space.model;

import javax.media.opengl.GL3bc;
import jinngine.math.Matrix3;
import jinngine.math.Vector3;
import jinngine.physics.Body;
import space.gl.RenderContext;
import space.stream.StructureInput;

/**
 *
 * @author Pierre
 */
public class Sphere implements MdlGeometry {

    final String name;
    final Vector3 center;
    final double radius;

    public Sphere(StructureInput di) {
        name = di.readString();
        center = di.readObject(Vector3.class);
        radius = di.readDouble();
    }

    public Drawable optimize(GL3bc gl) {
        return this;
    }

    public void draw(RenderContext gl) {
    }

    public void dispose(GL3bc gl) {
    }

    public void addGeometry(Body body) {
        body.addGeometry(new Matrix3(), center, new jinngine.geometry.Sphere(radius));
    }

    public void debug(GL3bc gl) {
    }
}
